<div class="layui-card-header SearchTable">
    <span id="detail_name_str" class="color_green">表单多选代码</span>
</div>

<div class="layui-card-body">
    <img style="width: 600px;height:200px" src="../../static/admin/demo/more_select.jpg"/>
<pre class="layui-code" lay-title="表单多选 HTML" lay-height="" lay-skin="" lay-encode="true">
  <div class="layui-row">
      <div class="layui-col-md12">
          <div class="layui-form-item">
              <label class="layui-form-label">测试多选</label>

              <div id="demo1" class="layui-input-inline" style="min-width:400px"></div>
          </div>
      </div>
  </div>
</pre>

<pre class="layui-code" lay-title="表单多选 数据源" lay-height="" lay-skin="" lay-encode="true">

    var datas = [{name: '张三', value: 1},{name: '李四', value: 2},{name: '王五', value: 3},];
    或
    <input type="hidden" id="d1" name="d1" value="1,2,3">
    <input type="hidden" id="d2" name="d1" value="[{name: '张三', value: 1},{name: '李四', value: 2},{name: '王五', value: 3},]">
</pre>

<pre class="layui-code" lay-title="表单多选 JS" lay-height="" lay-skin="" lay-encode="true">
layui.use(['xmSelect'], function () {
        var xmSelect = layui.xmSelect;
        //渲染多选
        var demo1 = xmSelect.render({
            el: '#demo1',
            name: 'fff',
            data: layui_ext.eval(layui_ext.value("d2")),//数据源
            initValue: $("#d1").val().split(",")//默认选中值
        });
    });

</pre>

</div>